package com.hy.service1;

import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.springframework.context.annotation.Bean;

public interface  HelloServiceIfaceLoad {

    @Bean(name = "helloService")
    default HelloService.Iface helloService() throws TTransportException {
        TTransport tTransport = new TSocket("localhost", 9898, 30000);
        TProtocol tProtocol = new TBinaryProtocol(tTransport);
        tTransport.open();
        HelloService.Iface iface = new HelloService.Client(tProtocol);
        return iface;
    }

}
